package day004.homework;

public class Practice02 {
    public static void main(String[] args) {
        evenSum(100);
    }

    public static void evenSum(int n) {
        int sum = 0;
        for (int i = 1; i <= n; i++) {
            if (i % 2 == 0) {
                sum += i;
            }
        }

        System.out.println("1-" + n + "的偶数和是：" + sum);
    }
}
